home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume15 / mush6.3kit / part02 < prev    next >
Encoding:
Internet Message Format  |  1988-07-06  |  59.0 KB

  1. Subject:  v15i086:  Mush (mail user's shell) upgrade kit, version 6.3, Part02/04
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: dheller@cory.Berkeley.EDU (Dan Heller)
  7. Posting-number: Volume 15, Issue 86
  8. Archive-name: mush6.3kit/part02
  9.  
  10. [  You will have to do
  11.     cat Diffs.6.3.[abc] | patch
  12.    to get install these patches.  --r$  ]
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of shell archive."
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'Diffs.6.3.a' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'Diffs.6.3.a'\"
  24. else
  25. echo shar: Extracting \"'Diffs.6.3.a'\" \(57387 characters\)
  26. sed "s/^X//" >'Diffs.6.3.a' <<'END_OF_FILE'
  27. X*** OLD/Makefile    Fri Jun 10 12:38:05 1988
  28. X--- Makefile    Thu Jun 30 13:05:31 1988
  29. X***************
  30. X*** 7,13 ****
  31. X  OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  32. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  33. X        folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
  34. X! HELP_FILES= README-6.0 README cmd_help mush.1
  35. X  MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
  36. X  
  37. X  CFLAGS= -O -DCURSES -DBSD
  38. X--- 7,13 ----
  39. X  OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  40. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  41. X        folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
  42. X! HELP_FILES= README-6.0 README cmd_help mush.1 Mailrc
  43. X  MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
  44. X  
  45. X  CFLAGS= -O -DCURSES -DBSD
  46. X*** OLD/README    Fri Jun 10 12:38:05 1988
  47. X--- README    Tue Jun 28 21:37:48 1988
  48. X***************
  49. X*** 9,22 ****
  50. X  
  51. X  When sending mail, mail to the addresses in the order given.
  52. X  
  53. X! Contained is the source for "Mail User's Shell" (MUSH), an interface
  54. X! for the sending, viewing and managing of electronic mail on UNIX(tm) systems.
  55. X  Redistribution of this code is permitted as long as all copyright notices
  56. X  remain intact and all other identifying notices remain in the code and
  57. X  in the binary.  This includes message headers on outgoing mail and
  58. X! the startup message.  Failing to adhere to this reflects on your poor
  59. X! sense of fair play and bad attitude -- you will probably fail in your
  60. X! social and business affairs with little honor and respect from your peers.
  61. X  
  62. X  With that out of the way...
  63. X  
  64. X--- 9,28 ----
  65. X  
  66. X  When sending mail, mail to the addresses in the order given.
  67. X  
  68. X! Mush is a Mail User Agent (MUA).  That is, it is used by the user to read mail,
  69. X! arrange it, delete it, or act as an interface to send mail to other users.
  70. X! A Mail Transport Agent (MTA) is the program that mush talks to.  The MTA
  71. X! actually delivers the mail to the destination (usually in the asynchronously
  72. X! with mush).
  73. X! 
  74. X! Contained is the source for "Mail User's Shell" (MUSH), an MUA that is
  75. X! designed to manage electronic mail on most UNIX(tm) systems.
  76. X  Redistribution of this code is permitted as long as all copyright notices
  77. X  remain intact and all other identifying notices remain in the code and
  78. X  in the binary.  This includes message headers on outgoing mail and
  79. X! the startup message.  Future releases will extract the release version
  80. X! from the message headers of mush-originated messages to aid in implementing
  81. X! features and providing backwards complatibility with previous versions.
  82. X  
  83. X  With that out of the way...
  84. X  
  85. X***************
  86. X*** 24,30 ****
  87. X  "config.h" (probably "config.h-dist") COPY it to config.h, edit it to reflect
  88. X  the system dependencines described there.  Decide which makefile applies
  89. X  to you.  makefile.sun applies only to suns and creates a binary called
  90. X! "mush."  If the binary ends in "tool", then the graphics (tool) mode will
  91. X  be used by default on invocation. Otherwise, you must specify -t for toolmode
  92. X  on sun workstations.  The SUNTOOL define must be set in the makefile.sun
  93. X  in order to compile the suntools version.  You don't need to be running
  94. X--- 30,36 ----
  95. X  "config.h" (probably "config.h-dist") COPY it to config.h, edit it to reflect
  96. X  the system dependencines described there.  Decide which makefile applies
  97. X  to you.  makefile.sun applies only to suns and creates a binary called
  98. X! "mush."  If the binary ends in "tool", then the graphics (suntools) mode will
  99. X  be used by default on invocation. Otherwise, you must specify -t for toolmode
  100. X  on sun workstations.  The SUNTOOL define must be set in the makefile.sun
  101. X  in order to compile the suntools version.  You don't need to be running
  102. X***************
  103. X*** 36,42 ****
  104. X  files not be compiled so the binary will be made smaller.
  105. X  
  106. X  The files makefile.x286 and makefile.x386 were created especially for
  107. X! xenix machines.  Depending on the configuration of your particular xenix box,
  108. X  some tweeking of the makefile flags may be necessary.  If your xenix
  109. X  release is 2.2 or higher then you must define USG. Libraries to use should
  110. X  be -ltinfo *not* -lcurses -ltermlib.  This is because the curses package
  111. X--- 42,48 ----
  112. X  files not be compiled so the binary will be made smaller.
  113. X  
  114. X  The files makefile.x286 and makefile.x386 were created especially for
  115. X! XENIX machines.  Depending on the configuration of your particular xenix box,
  116. X  some tweeking of the makefile flags may be necessary.  If your xenix
  117. X  release is 2.2 or higher then you must define USG. Libraries to use should
  118. X  be -ltinfo *not* -lcurses -ltermlib.  This is because the curses package
  119. X***************
  120. X*** 48,58 ****
  121. X  BSD and probably running a system-v flavor of unix -- this defines USG
  122. X  so that termio will be used.  Some older unix systems have SYSV defined
  123. X  in /usr/include/curses.h (which is used if you are compiling with CURSES)
  124. X! In most cases, these only generate annoying warning messages and does not
  125. X! effect the compilation of the code.
  126. X  
  127. X! Mush was designed to use sendmail as the Mail Transport Agent. However,
  128. X! other MTA's will work.  The MTA you use should be defined in config.h
  129. X  under the MAIL_DELIVERY macro define. By default, /usr/lib/sendmail -i
  130. X  is used -- the option, -i, tells sendmail not to accept "." on a line
  131. X  by itself as an end-of-file marker.
  132. X--- 54,81 ----
  133. X  BSD and probably running a system-v flavor of unix -- this defines USG
  134. X  so that termio will be used.  Some older unix systems have SYSV defined
  135. X  in /usr/include/curses.h (which is used if you are compiling with CURSES)
  136. X! In most cases, these may generate annoying warning messages but do not
  137. X! affect the compilation of the code.
  138. X  
  139. X! When you decide on an appropriate makefile, _copy_ it to a new file called
  140. X! Makefile.
  141. X! 
  142. X! When it comes to "compile-time definitions", you may use one of two methods:
  143. X!     -DDEFINITION  /* in your makefile */
  144. X!     #define DEFINITION /* in the config.h file */
  145. X! If the definition is of the form MACRO="string", then use:
  146. X!     -DMACRO=string
  147. X!     #define MACRO string
  148. X! For example, if you are on a system V machine, you may need to define
  149. X! SIGRET to be of type void because the signal() function doesn't return
  150. X! anything useful (or, a "void" type).  To define this, your makefile may
  151. X! have (as part of the CFLAGS setting):
  152. X!     -DSIGRET=void
  153. X! or your config.h file should have somewhere in it (doesn't matter where):
  154. X! #define SIGRET void
  155. X! 
  156. X! Mush was originally designed to use sendmail as the Mail Transport Agent.
  157. X! However, other MTA's will work.  The MTA you use should be defined in config.h
  158. X  under the MAIL_DELIVERY macro define. By default, /usr/lib/sendmail -i
  159. X  is used -- the option, -i, tells sendmail not to accept "." on a line
  160. X  by itself as an end-of-file marker.
  161. X***************
  162. X*** 84,92 ****
  163. X  Some MTA's, especially older ones like /bin/mail or execmail (xenix), do
  164. X  not conform to RFC822 and provide the required headers: From: and Date:.
  165. X  To remedy either #define OLD_MAILER in config.h or add the -D option
  166. X! OLD_MAILER in the appropriate makefile: -DOLD_MAILER as part of the CFLAGS
  167. X! variable.
  168. X  
  169. X  If your mailer does NOT have a verbose option, then you should not have
  170. X  VERBOSE_ARG defined.  Otherwise, define it to be whatever the
  171. X  verbose argument is for your mailer.
  172. X--- 107,125 ----
  173. X  Some MTA's, especially older ones like /bin/mail or execmail (xenix), do
  174. X  not conform to RFC822 and provide the required headers: From: and Date:.
  175. X  To remedy either #define OLD_MAILER in config.h or add the -D option
  176. X! OLD_MAILER in the appropriate makefile: -DOLD_MAILER
  177. X  
  178. X+ If your machine talks to other computers via uucp _and_ you have the
  179. X+ macro OLD_MAILER defined,  then you may want to define UUCP.  This will
  180. X+ change the From: line to have your return address look like "host!user"
  181. X+ rather than "user@host" (which is the default).
  182. X+ 
  183. X+ If your mailer does *NOT* like commas between addresses (smail, xenix and
  184. X+ xenix machines), then you should define NO_COMMAS.
  185. X+ 
  186. X+ If your signal() returns void, SIGRET should be defined to be "void".
  187. X+ This mostly applies to SVR3.  By default, SIGRET is defined to be "int".
  188. X+ 
  189. X  If your mailer does NOT have a verbose option, then you should not have
  190. X  VERBOSE_ARG defined.  Otherwise, define it to be whatever the
  191. X  verbose argument is for your mailer.
  192. X***************
  193. X*** 151,165 ****
  194. X  
  195. X  Maintenance:
  196. X  
  197. X! If you want to use dbx or any other debugger, the undocumented flag, -e
  198. X! should be used as command line argument when you run the binary under
  199. X! the debugger.  What this flag does is prevents your echo from being
  200. X! turned off and leaving cbreak on, thus, keeping your tty in a sane state.
  201. X! Beware of curses mode tho, since it must be turned off for that -- e.g.
  202. X! the -e flag is overridden if you enter curses mode.  The -e flag can be
  203. X! used in general usage anyway, but there's no difference known to the user
  204. X! except for the fact that you can not type control characters.
  205. X! 
  206. X  If you have memory allocation checking and validation (sun 3.0+ ?) then
  207. X  define M_DEBUG in the makefile (main.c) and add the library
  208. X  /usr/lib/debug/malloc.o to the library list. Do this only if you are
  209. X--- 184,198 ----
  210. X  
  211. X  Maintenance:
  212. X  
  213. X! If you want to use dbx or any other debugger, or to use your default tty
  214. X! driver, -e may be used as command line argument when you run the program.
  215. X! What this flag does is prevents your echo from being turned off and leaving
  216. X! cbreak off, thus, keeping your tty in a sane state.
  217. X! Beware of curses mode tho, since it will be automatically turned off for
  218. X! that mode.  The -e flag is discouraged for future use (when automatic
  219. X! filename completion is introduced in the next version and other keyboard
  220. X! accelerators are introduced).
  221. X!     
  222. X  If you have memory allocation checking and validation (sun 3.0+ ?) then
  223. X  define M_DEBUG in the makefile (main.c) and add the library
  224. X  /usr/lib/debug/malloc.o to the library list. Do this only if you are
  225. X***************
  226. X*** 169,174 ****
  227. X--- 202,211 ----
  228. X  the sunwindows program will get a SIGXCPU (cpu time limit exceeded)
  229. X  because of the large amount of opening and closing large pixrects and
  230. X  devices.  For this reason, SIGXPCPU is is caught in main.c.
  231. X+ 
  232. X+ The "warning" variable may be set (at runtime in your .mushrc or as
  233. X+ a command: "set warning") to aid in finding runtime errors that aren't
  234. X+ fatal.
  235. X  
  236. X  If you ever get "Message N has bad date: <date string>" then note
  237. X  the FORMAT of that date and edit dates.c.  There are a number of
  238. X*** OLD/bind.c    Fri Jun 10 12:38:06 1988
  239. X--- bind.c    Tue Jun 28 21:37:49 1988
  240. X***************
  241. X*** 185,191 ****
  242. X  {
  243. X      char buf[MAX_BIND_LEN], buf2[256];
  244. X      register int x;
  245. X!     int (*oldint)(), (*oldquit)();
  246. X      int unbind = (argv && **argv == 'u');
  247. X      int ret = -1; /* return value */
  248. X  
  249. X--- 185,191 ----
  250. X  {
  251. X      char buf[MAX_BIND_LEN], buf2[256];
  252. X      register int x;
  253. X!     SIGRET (*oldint)(), (*oldquit)();
  254. X      int unbind = (argv && **argv == 'u');
  255. X      int ret = -1; /* return value */
  256. X  
  257. X*** OLD/bindings.h    Fri Jun 10 12:38:06 1988
  258. X--- bindings.h    Tue Jun 28 21:37:49 1988
  259. X***************
  260. X*** 6,11 ****
  261. X--- 6,14 ----
  262. X  #define A_PREFIX_B    2
  263. X  #define B_PREFIX_A    3
  264. X  
  265. X+ #ifdef NULL_MAP
  266. X+ #undef NULL_MAP
  267. X+ #endif /* NULL_MAP */
  268. X  #define NULL_MAP    (struct cmd_map *)0
  269. X  #define C_NULL        0
  270. X  #define C_GOTO_MSG    1
  271. X*** OLD/cmd_help    Thu May 12 21:14:24 1988
  272. X--- cmd_help    Tue Jun 28 21:37:51 1988
  273. X***************
  274. X*** 162,168 ****
  275. X  
  276. X  %sort_help%
  277. X  usage: sort [-] [d | a | s | S | R]
  278. X!   d         sort according to date received
  279. X    a         author (alphabetical)
  280. X    s         subject ignoring Re: as part of the subject
  281. X    R         subject (alphabetical)
  282. X--- 162,168 ----
  283. X  
  284. X  %sort_help%
  285. X  usage: sort [-] [d | a | s | S | R]
  286. X!   d         sort according to date
  287. X    a         author (alphabetical)
  288. X    s         subject ignoring Re: as part of the subject
  289. X    R         subject (alphabetical)
  290. X***************
  291. X*** 170,176 ****
  292. X  The optional `-' flag will reverse the order of sorting
  293. X  By default (no arguments), sort sorts messages by status:
  294. X  New, unread messages are first, followed by preserved messages
  295. X! and finally the deleted messages are placed at the end
  296. X  %%
  297. X  
  298. X  %pick%
  299. X--- 170,180 ----
  300. X  The optional `-' flag will reverse the order of sorting
  301. X  By default (no arguments), sort sorts messages by status:
  302. X  New, unread messages are first, followed by preserved messages
  303. X! and finally the deleted messages are placed at the end.
  304. X! 
  305. X! If "date_received" is set, sorting by date is sorted by
  306. X! the date you received the message.  Otherwise, messages
  307. X! are sorted by date sent by the original author.
  308. X  %%
  309. X  
  310. X  %pick%
  311. X***************
  312. X*** 280,303 ****
  313. X  
  314. X  %headers%
  315. X  usage: headers [+ | - | N] [-H:c]
  316. X! print out a screenful of headers.
  317. X! +  print the next screenful.
  318. X! -  print the previous screenful.
  319. X! N  (where N is a number) print a screenful starting at N.
  320. X! set show_deleted to list deleted messages.
  321. X! cmd h headers        look like UCB-Mail
  322. X! cmd H Headers        show deleted messages (or set show_deleted)
  323. X! cmd z headers +      `z' is next screenful
  324. X  
  325. X! Arguments to the headers command include -H:c where `c' is one of
  326. X!     n    just print messages headers of NEW messages
  327. X      d    deleted messages
  328. X      u    unread messages
  329. X      o    old messages
  330. X!     r    messages that have been replied to
  331. X      a    all messages (mostly for the command line argument -H:c)
  332. X! 
  333. X! piping to headers will print the headers of the "output" messages.
  334. X  %%
  335. X  
  336. X  %hdr_format%
  337. X--- 284,308 ----
  338. X  
  339. X  %headers%
  340. X  usage: headers [+ | - | N] [-H:c]
  341. X!      print out a screenful of headers.
  342. X  
  343. X! Arguments include:
  344. X!     +  print the next screenful (or use the 'z' command).
  345. X!     -  print the previous screenful (or use 'z-' ).
  346. X!     N  print a screenful starting at message number N.
  347. X! 
  348. X! "set show_deleted" to list deleted messages.
  349. X! 
  350. X! headers -H:c where `c' is one of
  351. X!     n    new messages
  352. X      d    deleted messages
  353. X      u    unread messages
  354. X      o    old messages
  355. X!     r    replied-to messages
  356. X!     s    saved messages
  357. X!     p    preserved messages
  358. X      a    all messages (mostly for the command line argument -H:c)
  359. X! The command, ":r" is equivalent to "headers -H:r"
  360. X  %%
  361. X  
  362. X  %hdr_format%
  363. X*** OLD/commands.c    Thu May 12 21:14:26 1988
  364. X--- commands.c    Tue Jul  5 12:08:11 1988
  365. X***************
  366. X*** 107,113 ****
  367. X      }
  368. X      if (x)
  369. X      if (!strcmp(p, "top"))
  370. X!         turnon(flg, TOP);
  371. X      else if (*p == '+') {
  372. X          turnon(flg, NO_PAGE);
  373. X          turnon(flg, NO_HEADER);
  374. X--- 107,113 ----
  375. X      }
  376. X      if (x)
  377. X      if (!strcmp(p, "top"))
  378. X!         turnon(flg, M_TOP);
  379. X      else if (*p == '+') {
  380. X          turnon(flg, NO_PAGE);
  381. X          turnon(flg, NO_HEADER);
  382. X***************
  383. X*** 124,130 ****
  384. X                      isoff(msg[current_msg].m_flags, UNREAD))
  385. X          current_msg++;
  386. X      if (p && (*p == '-' || !strcmp(p, "previous"))) {
  387. X!         while (--current_msg >= 0 && ison(msg[current_msg].m_flags, DELETE))
  388. X          ;
  389. X          if (current_msg < 0) {
  390. X          print("No previous message.\n");
  391. X--- 124,132 ----
  392. X                      isoff(msg[current_msg].m_flags, UNREAD))
  393. X          current_msg++;
  394. X      if (p && (*p == '-' || !strcmp(p, "previous"))) {
  395. X!         while (--current_msg >= 0 &&
  396. X!         (ison(msg[current_msg].m_flags, DELETE) ||
  397. X!          ison(msg[current_msg].m_flags, SAVED)))
  398. X          ;
  399. X          if (current_msg < 0) {
  400. X          print("No previous message.\n");
  401. X***************
  402. X*** 141,147 ****
  403. X          /* "type" or "print" prints the current only -- "next" goes on.. */
  404. X          if (!p || !*p || *p == 'n')
  405. X          while (current_msg < msg_cnt &&
  406. X!             ison(msg[current_msg].m_flags, DELETE))
  407. X              current_msg++;
  408. X          if (current_msg >= msg_cnt) {
  409. X          print("No more messages.\n");
  410. X--- 143,150 ----
  411. X          /* "type" or "print" prints the current only -- "next" goes on.. */
  412. X          if (!p || !*p || *p == 'n')
  413. X          while (current_msg < msg_cnt &&
  414. X!             (ison(msg[current_msg].m_flags, DELETE) ||
  415. X!              ison(msg[current_msg].m_flags, SAVED)))
  416. X              current_msg++;
  417. X          if (current_msg >= msg_cnt) {
  418. X          print("No more messages.\n");
  419. X***************
  420. X*** 207,213 ****
  421. X      register FILE    *pp;
  422. X      register long     flags = 0;
  423. X      char        print_cmd[128], *printer, c, *cmd;
  424. X!     int            total = 0, (*oldint)(), (*oldquit)();
  425. X  
  426. X      turnon(flags, NO_IGNORE);
  427. X      if (!(printer = do_set(set_options, "printer")) || !*printer)
  428. X--- 210,217 ----
  429. X      register FILE    *pp;
  430. X      register long     flags = 0;
  431. X      char        print_cmd[128], *printer, c, *cmd;
  432. X!     int            total = 0;
  433. X!     SIGRET        (*oldint)(), (*oldquit)();
  434. X  
  435. X      turnon(flags, NO_IGNORE);
  436. X      if (!(printer = do_set(set_options, "printer")) || !*printer)
  437. X***************
  438. X*** 319,345 ****
  439. X      turnon(flg, NO_HEADER);
  440. X      else
  441. X      turnon(flg, UPDATE_STATUS);
  442. X-     if (do_set(set_options, "keepsave"))
  443. X-     firstchar = 'c';
  444. X      for (n = msg_number = 0; msg_number < msg_cnt; msg_number++)
  445. X      if (msg_bit(list, msg_number)) {
  446. X              print("%sing msg %d... ",
  447. X          (firstchar == 's')? "Sav" : "Writ", msg_number+1);
  448. X          print_more("(%d lines)\n", copy_msg(msg_number, mail_fp, flg));
  449. X-         /* only mark "deleted" if mailfile is /usr/spool/mail and
  450. X-          * we're not "copying.  If keepsave is set, then firstchar
  451. X-          * will have already been changed to 'c'
  452. X-          */
  453. X-         if (!strcmp(mailfile, spoolfile) && firstchar != 'c' &&
  454. X-         isoff(glob_flags, READ_ONLY))
  455. X-         turnon(msg[msg_number].m_flags, DELETE);
  456. X          n++;
  457. X      }
  458. X      fclose(mail_fp);
  459. X      print_more("%s %d msg%s to %s\n",
  460. X          (*mode == 'a')? "Appended" : "Saved", n, (n != 1)? "s": "", file);
  461. X-     if (!strcmp(mailfile, spoolfile))
  462. X-     turnon(glob_flags, DO_UPDATE);
  463. X  #ifdef SUNTOOL
  464. X      if (istool) {
  465. X      unlock_cursors();
  466. X--- 323,342 ----
  467. X      turnon(flg, NO_HEADER);
  468. X      else
  469. X      turnon(flg, UPDATE_STATUS);
  470. X      for (n = msg_number = 0; msg_number < msg_cnt; msg_number++)
  471. X      if (msg_bit(list, msg_number)) {
  472. X              print("%sing msg %d... ",
  473. X          (firstchar == 's')? "Sav" : "Writ", msg_number+1);
  474. X          print_more("(%d lines)\n", copy_msg(msg_number, mail_fp, flg));
  475. X          n++;
  476. X+         if (isoff(msg[msg_number].m_flags, SAVED) && firstchar != 'c') {
  477. X+         turnon(glob_flags, DO_UPDATE);
  478. X+         turnon(msg[msg_number].m_flags, SAVED);
  479. X+         }
  480. X      }
  481. X      fclose(mail_fp);
  482. X      print_more("%s %d msg%s to %s\n",
  483. X          (*mode == 'a')? "Appended" : "Saved", n, (n != 1)? "s": "", file);
  484. X  #ifdef SUNTOOL
  485. X      if (istool) {
  486. X      unlock_cursors();
  487. X***************
  488. X*** 414,420 ****
  489. X      do  {
  490. X      if (cdpath) {
  491. X          char c;
  492. X!         if (p2 = any(cdpath, " \t"))
  493. X          c = *p2, *p2 = 0;
  494. X          (void) sprintf(buf, "%s/%s", cdpath, p);
  495. X          if (cdpath = p2) /* assign and compare to NULL */
  496. X--- 411,417 ----
  497. X      do  {
  498. X      if (cdpath) {
  499. X          char c;
  500. X!         if (p2 = any(cdpath, " \t:"))
  501. X          c = *p2, *p2 = 0;
  502. X          (void) sprintf(buf, "%s/%s", cdpath, p);
  503. X          if (cdpath = p2) /* assign and compare to NULL */
  504. X***************
  505. X*** 514,520 ****
  506. X      /* goto next available message if current was just deleted.
  507. X       * If there are no more messages, turnoff prnt_next.
  508. X       */
  509. X!     if (!iscurses && !undel && ison(msg[current_msg].m_flags, DELETE))
  510. X      next_msg();
  511. X  
  512. X      if (prnt_next && !undel && !iscurses)
  513. X--- 511,519 ----
  514. X      /* goto next available message if current was just deleted.
  515. X       * If there are no more messages, turnoff prnt_next.
  516. X       */
  517. X!     if (!iscurses && !undel &&
  518. X!     ison(msg[current_msg].m_flags, DELETE) ||
  519. X!     ison(msg[current_msg].m_flags, SAVED))
  520. X      next_msg();
  521. X  
  522. X      if (prnt_next && !undel && !iscurses)
  523. X***************
  524. X*** 602,612 ****
  525. X      error(buf);
  526. X      return -1;
  527. X      }
  528. X!     turnon(glob_flags, IGN_SIGS);
  529. X!     while (fgets(buf, 127, pp))
  530. X!     wprint(buf);
  531. X      (void) pclose(pp);
  532. X!     turnoff(glob_flags, IGN_SIGS);
  533. X      return 0;
  534. X  }
  535. X  
  536. X--- 601,611 ----
  537. X      error(buf);
  538. X      return -1;
  539. X      }
  540. X!     (void) do_pager(NULL, TRUE);
  541. X!     while (fgets(buf, 127, pp) && do_pager(buf, FALSE) != EOF)
  542. X!     ;
  543. X      (void) pclose(pp);
  544. X!     (void) do_pager(NULL, FALSE);
  545. X      return 0;
  546. X  }
  547. X  
  548. X*** OLD/curs_io.c    Fri Jun 10 12:38:09 1988
  549. X--- curs_io.c    Tue Jun 28 21:37:56 1988
  550. X***************
  551. X*** 54,59 ****
  552. X--- 54,61 ----
  553. X      register int c, literal_next = FALSE;
  554. X      int count = offset;
  555. X  
  556. X+     fflush(stdout); /* make sure everything is flushed before getting input */
  557. X+ 
  558. X      while ((c = getchar()) != '\n' && c != '\r' && c != EOF &&
  559. X      isoff(glob_flags, WAS_INTR)) {
  560. X      /* echo isn't set, so whatever the character, enter it */
  561. X*** OLD/curses.c    Thu May 12 21:14:28 1988
  562. X--- curses.c    Tue Jun 28 21:37:59 1988
  563. X***************
  564. X*** 341,347 ****
  565. X              (c == C_DELETE_MSG || c == C_DELETE_LIST)? "":"un", list);
  566. X              putchar('\n');
  567. X          }
  568. X!         if (ison(msg[current_msg].m_flags, DELETE))
  569. X              (void) next_msg();
  570. X          if (isoff(msg[current_msg].m_flags, DELETE) &&
  571. X              do_set(set_options, "autoprint"))
  572. X--- 341,348 ----
  573. X              (c == C_DELETE_MSG || c == C_DELETE_LIST)? "":"un", list);
  574. X              putchar('\n');
  575. X          }
  576. X!         if (ison(msg[current_msg].m_flags, DELETE) ||
  577. X!             ison(msg[current_msg].m_flags, SAVED))
  578. X              (void) next_msg();
  579. X          if (isoff(msg[current_msg].m_flags, DELETE) &&
  580. X              do_set(set_options, "autoprint"))
  581. X***************
  582. X*** 471,477 ****
  583. X      /* change to a new folder */
  584. X      when C_FOLDER :
  585. X          for (;;) {
  586. X!         int (*oldint)(), (*oldquit)();
  587. X          on_intr();
  588. X          print("New folder (?=list): ");
  589. X          c = Getstr(file, COLS-22, 0);
  590. X--- 472,478 ----
  591. X      /* change to a new folder */
  592. X      when C_FOLDER :
  593. X          for (;;) {
  594. X!         SIGRET (*oldint)(), (*oldquit)();
  595. X          on_intr();
  596. X          print("New folder (?=list): ");
  597. X          c = Getstr(file, COLS-22, 0);
  598. X***************
  599. X*** 718,724 ****
  600. X      int n;
  601. X  
  602. X      for (n = 0; n < COLS; n++)
  603. X!     if ((buf = mvinch(line, n) & A_CHARTEXT) == '\0')
  604. X          break;
  605. X      buf[n] = '\0';
  606. X  #endif /* A_CHARTEXT */
  607. X--- 719,725 ----
  608. X      int n;
  609. X  
  610. X      for (n = 0; n < COLS; n++)
  611. X!     if ((buf[n] = (mvinch(line, n) & A_CHARTEXT)) == '\0')
  612. X          break;
  613. X      buf[n] = '\0';
  614. X  #endif /* A_CHARTEXT */
  615. X*** OLD/dates.c    Wed Mar  9 12:26:28 1988
  616. X--- dates.c    Tue Jun 28 21:37:59 1988
  617. X***************
  618. X*** 80,92 ****
  619. X       */
  620. X  
  621. X      /* else, get the "date" line, if that fails, get the date in "From" line */
  622. X!     if ((p = header_field(n, "date")) && (p2 = parse_date(p)))
  623. X      return p2;
  624. X  
  625. X!     (void) fseek(tmpf, msg[n].m_offset, L_SET);
  626. X!     (void) fgets(line, BUFSIZ, tmpf);
  627. X!     if (!(p = index(line, ' ')) || !(p2 = index(p+1, ' ')))
  628. X      return NULL;
  629. X      p = p2;
  630. X  
  631. X      if (!(p2 = parse_date(p)))
  632. X--- 80,97 ----
  633. X       */
  634. X  
  635. X      /* else, get the "date" line, if that fails, get the date in "From" line */
  636. X!     if (
  637. X! #ifndef MSG_SEPARATOR
  638. X!     isoff(glob_flags, DATE_RECV) &&
  639. X! #endif /* MSG_SEPARATOR */
  640. X!     (p = header_field(n, "date")) && (p2 = parse_date(p)))
  641. X      return p2;
  642. X  
  643. X! #ifndef MSG_SEPARATOR
  644. X!     if (fseek(tmpf, msg[n].m_offset, L_SET) == -1 || !fgets(line, BUFSIZ, tmpf)
  645. X!     || !(p = index(line, ' ')) || !(p2 = index(p+1, ' ')))
  646. X      return NULL;
  647. X+ #endif /* MSG_SEPARATOR */
  648. X      p = p2;
  649. X  
  650. X      if (!(p2 = parse_date(p)))
  651. X*** OLD/doproc.c    Sat Apr  2 16:13:34 1988
  652. X--- doproc.c    Tue Jun 28 21:38:00 1988
  653. X***************
  654. X*** 192,198 ****
  655. X          print("Type in Main Panel Window a filename to save message");
  656. X          return;
  657. X          }
  658. X!     else if (value <= 1) {
  659. X          register char *p = panel_get_value(file_item);
  660. X          register char *p2 = panel_get_value(msg_num_item);
  661. X          if ((!p || !*p) && (!(p = do_set(set_options, "mbox")) || !*p))
  662. X--- 192,198 ----
  663. X          print("Type in Main Panel Window a filename to save message");
  664. X          return;
  665. X          }
  666. X!     else if (value == 0) {
  667. X          register char *p = panel_get_value(file_item);
  668. X          register char *p2 = panel_get_value(msg_num_item);
  669. X          if ((!p || !*p) && (!(p = do_set(set_options, "mbox")) || !*p))
  670. X*** OLD/execute.c    Fri Jun 10 12:38:11 1988
  671. X--- execute.c    Tue Jun 28 21:38:01 1988
  672. X***************
  673. X*** 22,30 ****
  674. X      union wait status;
  675. X  #endif /* SYSV */
  676. X  #ifdef SIGCONT
  677. X!     int    (*oldstop)(), (*oldcont)();
  678. X  #endif /* SIGCONT */
  679. X!     int pid, (*oldint)(), (*oldquit)();
  680. X  
  681. X  #ifdef SUNTOOL
  682. X      if (istool) {
  683. X--- 22,31 ----
  684. X      union wait status;
  685. X  #endif /* SYSV */
  686. X  #ifdef SIGCONT
  687. X!     SIGRET (*oldstop)(), (*oldcont)();
  688. X  #endif /* SIGCONT */
  689. X!     int pid;
  690. X!     SIGRET (*oldint)(), (*oldquit)();
  691. X  
  692. X  #ifdef SUNTOOL
  693. X      if (istool) {
  694. X***************
  695. X*** 81,86 ****
  696. X--- 82,88 ----
  697. X      turnoff(glob_flags, IGN_SIGS);
  698. X  }
  699. X  
  700. X+ SIGRET
  701. X  sigchldcatcher()
  702. X  {
  703. X  #ifdef SUNTOOL
  704. X*** OLD/hdrs.c    Thu Apr 28 22:48:02 1988
  705. X--- hdrs.c    Tue Jul  5 12:46:40 1988
  706. X***************
  707. X*** 51,57 ****
  708. X  register char **argv, list[];
  709. X  {
  710. X      register int   pageful = 0, fnd;
  711. X!     int        (*oldint)(), (*oldquit)(), show_deleted;
  712. X      static int     cnt;
  713. X      register char  *p;
  714. X      char        first_char = (argc) ? **argv: 'h';
  715. X--- 51,58 ----
  716. X  register char **argv, list[];
  717. X  {
  718. X      register int   pageful = 0, fnd;
  719. X!     SIGRET        (*oldint)(), (*oldquit)();
  720. X!     int           show_deleted;
  721. X      static int     cnt;
  722. X      register char  *p;
  723. X      char        first_char = (argc) ? **argv: 'h';
  724. X***************
  725. X*** 191,197 ****
  726. X          when 'o': special = OLD;
  727. X          when 'd': special = DELETE;
  728. X          when 'r': special = REPLIED;
  729. X!         otherwise: print("choose from n,u,o,d,r, or a"); return -1;
  730. X      }
  731. X      if (debug)
  732. X      (void) check_flags(special);
  733. X--- 192,200 ----
  734. X          when 'o': special = OLD;
  735. X          when 'd': special = DELETE;
  736. X          when 'r': special = REPLIED;
  737. X!         when 's': special = SAVED;
  738. X!         when 'p': special = PRESERVE;
  739. X!         otherwise: print("choose from n,u,o,d,r,s,p or a"); return -1;
  740. X      }
  741. X      if (debug)
  742. X      (void) check_flags(special);
  743. X***************
  744. X*** 249,267 ****
  745. X  char *
  746. X  compose_hdr(cnt)
  747. X  {
  748. X!     static char buf[256];
  749. X!     register char *p, *b;
  750. X!     char from[256], subject[256], date[17], lines[16], chars[16], line[256];
  751. X      char to[256], addr[256], name[256], status[2];
  752. X!     char Day[3], Mon[4], Tm[8], Yr[5], Wkday[4], *date_p;
  753. X  
  754. X      /* status of the message */
  755. X      if (ison(msg[cnt].m_flags, DELETE))
  756. X      status[0] = '*';
  757. X-     else if (ison(msg[cnt].m_flags, OLD) && ison(msg[cnt].m_flags, UNREAD))
  758. X-     status[0] = 'U';
  759. X      else if (ison(msg[cnt].m_flags, PRESERVE))
  760. X      status[0] = 'P';
  761. X      else if (isoff(msg[cnt].m_flags, UNREAD))
  762. X      status[0] = ' ';
  763. X      else
  764. X--- 252,273 ----
  765. X  char *
  766. X  compose_hdr(cnt)
  767. X  {
  768. X!     static char        buf[256];
  769. X!     register char    *p, *p2, *b;
  770. X!     int            len, do_pad = FALSE, val, pad, got_dot, isauthor = 0;
  771. X!     char from[256], subject[256], date[17], lines[16], chars[16];
  772. X      char to[256], addr[256], name[256], status[2];
  773. X!     char Day[3], Mon[4], Tm[8], Yr[5], Wkday[4], *date_p, *p3;
  774. X  
  775. X      /* status of the message */
  776. X      if (ison(msg[cnt].m_flags, DELETE))
  777. X      status[0] = '*';
  778. X      else if (ison(msg[cnt].m_flags, PRESERVE))
  779. X      status[0] = 'P';
  780. X+     else if (ison(msg[cnt].m_flags, SAVED))
  781. X+     status[0] = 'S';
  782. X+     else if (ison(msg[cnt].m_flags, OLD) && ison(msg[cnt].m_flags, UNREAD))
  783. X+     status[0] = 'U';
  784. X      else if (isoff(msg[cnt].m_flags, UNREAD))
  785. X      status[0] = ' ';
  786. X      else
  787. X***************
  788. X*** 273,279 ****
  789. X      status[1] = ' ';
  790. X  
  791. X      to[0] = from[0] = subject[0] = date[0] = lines[0] = chars[0] = addr[0] =
  792. X!     name[0] = line[0] = Day[0] = Mon[0] = Tm[0] = Yr[0] = Wkday[0] = 0;
  793. X  
  794. X      /* who's the message to */
  795. X      if ((p = header_field(cnt, "to")) ||
  796. X--- 279,285 ----
  797. X      status[1] = ' ';
  798. X  
  799. X      to[0] = from[0] = subject[0] = date[0] = lines[0] = chars[0] = addr[0] =
  800. X!     name[0] = Day[0] = Mon[0] = Tm[0] = Yr[0] = Wkday[0] = 0;
  801. X  
  802. X      /* who's the message to */
  803. X      if ((p = header_field(cnt, "to")) ||
  804. X***************
  805. X*** 281,306 ****
  806. X      (p = header_field(cnt, "apparently-to")))
  807. X      Strncpy(to, p);
  808. X  
  809. X!     /* who the messages is from--
  810. X!      * %f        From field
  811. X!      * %a        From address
  812. X!      * %n        From name
  813. X       */
  814. X      if (!(p = header_field(cnt, "from"))) {
  815. X!     /* if all else fails, then get the first token in "From" line */
  816. X!     register char *p2;
  817. X!     p = ""; /* just in case */
  818. X!     if (fseek(tmpf, msg[cnt].m_offset, L_SET) == -1 ||
  819. X!         !(p2 = fgets(line, sizeof(line), tmpf))) {
  820. X!         error("fseek in %s (msg %d, folder=%s)", tempfile, cnt+1, mailfile);
  821. X!         turnon(glob_flags, READ_ONLY);
  822. X!     } else if (!(p = index(p2, ' ')))
  823. X!         print("Fudged \"From\" line: %s", p2);
  824. X!     else if (p2 = any(++p, " \t"))
  825. X!         *p2 = 0;
  826. X      }
  827. X!     skipspaces(0);
  828. X!     (void) no_newln(p);
  829. X      /* if the "from" line produced the user's login name, then the message is
  830. X       * from the user -- attempt to give more useful information by telling
  831. X       * to whom the message was sent.  This is not possible if the "to" header
  832. X--- 287,321 ----
  833. X      (p = header_field(cnt, "apparently-to")))
  834. X      Strncpy(to, p);
  835. X  
  836. X!     /*
  837. X!      * Read the "From " line first. If it's from us, login's will match.
  838. X!      * Also, we have the date received at our disposal.
  839. X       */
  840. X+ #ifndef MSG_SEPARATOR
  841. X+     p = ""; /* just in case */
  842. X+     if (fseek(tmpf, msg[cnt].m_offset, L_SET) == -1 ||
  843. X+     !(p2 = fgets(from, sizeof(from), tmpf))) {
  844. X+     error("fseek in %s (msg %d, folder=%s)", tempfile, cnt+1, mailfile);
  845. X+     turnon(glob_flags, READ_ONLY);
  846. X+     } else if (!(p = index(p2, ' ')))
  847. X+     print("Fudged \"From\" line: %s", p2);
  848. X+     else {
  849. X+     skipspaces(1);
  850. X+     if (p2 = any(p, " \t")) {
  851. X+         /* p now points to null terminated login name */
  852. X+         for (*p2++ = 0; isspace(*p2); p2++)
  853. X+         ; /* p2 points to date received */
  854. X+         Strncpy(buf, p2); /* buf is only used till "date" is filled */
  855. X+         p2 = buf;
  856. X+     }
  857. X+     }
  858. X+ #else
  859. X      if (!(p = header_field(cnt, "from"))) {
  860. X!     wprint("Error in msg %d's format. No \"From:\" line.\n", cnt+1);
  861. X!     return "               "; /* Real bad news here.... */
  862. X      }
  863. X! #endif /* MSG_SEPARATOR */
  864. X! 
  865. X      /* if the "from" line produced the user's login name, then the message is
  866. X       * from the user -- attempt to give more useful information by telling
  867. X       * to whom the message was sent.  This is not possible if the "to" header
  868. X***************
  869. X*** 307,325 ****
  870. X       * failed to get info (which is probably impossible).
  871. X       */
  872. X      if (!strcmp(p, login) && *to) {
  873. X!     (void) strcpy(from, "TO: ");
  874. X!     (void) strncpy(from+4, to, sizeof(from)-4), from[sizeof(from)-4] = 0;
  875. X!     (void) get_name_n_addr(from+4, name+4, addr+4);
  876. X!     if (name[4])
  877. X!         (void) strncpy(name,"TO: ",4); /* strncpy doesn't null terminate */
  878. X      if (addr[4])
  879. X!         (void) strncpy(addr,"TO: ",4); /* don't overwrite name there */
  880. X      } else {
  881. X!     Strncpy(from, p);
  882. X      (void) get_name_n_addr(from, name, addr);
  883. X      }
  884. X  
  885. X!     if (date_p = msg_date(cnt))
  886. X      /* don't take weekday unless specified explicitly.  See 'D' below */
  887. X      date_to_string(date_p, Yr, Mon, Day, NULL, Tm, date);
  888. X  
  889. X--- 322,355 ----
  890. X       * failed to get info (which is probably impossible).
  891. X       */
  892. X      if (!strcmp(p, login) && *to) {
  893. X!     isauthor = TRUE;
  894. X!     (void) get_name_n_addr(to, name+4, addr+4);
  895. X      if (addr[4])
  896. X!         (void) strncpy(addr, "TO: ", 4);
  897. X!     if (name[4]) {  /* check to see if a name got added */
  898. X!         (void) strncpy(name, "TO: ", 4);
  899. X!         Strncpy(from, name);
  900. X!     } else
  901. X!         Strncpy(from, addr);
  902. X      } else {
  903. X! #ifndef MSG_SEPARATOR
  904. X!     if (p = header_field(cnt, "from"))
  905. X! #endif /* MSG_SEPARATOR */
  906. X!         Strncpy(from, p);
  907. X      (void) get_name_n_addr(from, name, addr);
  908. X      }
  909. X  
  910. X! #ifndef MSG_SEPARATOR
  911. X!     /* hackers note: p2 already points to a ctime(3) string with weekday
  912. X!      * name and month and all that -- I'm inefficiently converting to
  913. X!      * a different format just to be converted back again later. Change this.
  914. X!      */
  915. X!     if (ison(glob_flags, DATE_RECV))
  916. X!     date_p = parse_date(p2);
  917. X!     else
  918. X! #endif /* MSG_SEPARATOR */
  919. X!     date_p = msg_date(cnt);
  920. X!     if (date_p)
  921. X      /* don't take weekday unless specified explicitly.  See 'D' below */
  922. X      date_to_string(date_p, Yr, Mon, Day, NULL, Tm, date);
  923. X  
  924. X***************
  925. X*** 357,364 ****
  926. X      else if (*p == '%') {
  927. X          char fmt[64];
  928. X          register char *p2 = fmt;
  929. X-         int len, got_dot = FALSE;
  930. X  
  931. X          *p2++ = '%';
  932. X          if (p[1] != '-')
  933. X          *p2++ = '-';
  934. X--- 387,395 ----
  935. X      else if (*p == '%') {
  936. X          char fmt[64];
  937. X          register char *p2 = fmt;
  938. X  
  939. X+         /* first check for string padding: %5n, %.4a, %10.5f, %-.3l etc. */
  940. X+         do_pad = pad = val = got_dot = 0;
  941. X          *p2++ = '%';
  942. X          if (p[1] != '-')
  943. X          *p2++ = '-';
  944. X***************
  945. X*** 366,389 ****
  946. X          *++p;
  947. X          while (isdigit(*++p) || !got_dot && *p == '.') {
  948. X          if (*p == '.')
  949. X!             got_dot = TRUE;
  950. X          *p2++ = *p;
  951. X          }
  952. X          if (!got_dot && isdigit(p[-1])) {
  953. X-         int val;
  954. X          *p2 = 0; /* assure null termination */
  955. X          val = atoi(fmt+1);
  956. X!         p2 += strlen(sprintf(p2, ".%d", (val >= 0 ? val : -val)));
  957. X          }
  958. X          *p2++ = 's', *p2 = 0;
  959. X          switch (*p) {
  960. X!         case 'f': p2 = from;
  961. X          when 'a':
  962. X              if (!*(p2 = addr))
  963. X              p2 = from;
  964. X          when 'n':
  965. X              if (!*(p2 = name))
  966. X!             p2 = from;
  967. X          when '%': p2 = "%";
  968. X          when 't': p2 = to;
  969. X          when 's': p2 = subject;
  970. X--- 397,425 ----
  971. X          *++p;
  972. X          while (isdigit(*++p) || !got_dot && *p == '.') {
  973. X          if (*p == '.')
  974. X!             got_dot = TRUE, val = pad, pad = 0;
  975. X!         else
  976. X!             pad = pad * 10 + *p - '0';
  977. X          *p2++ = *p;
  978. X          }
  979. X          if (!got_dot && isdigit(p[-1])) {
  980. X          *p2 = 0; /* assure null termination */
  981. X          val = atoi(fmt+1);
  982. X!         if (val < 0)
  983. X!             val = -val;
  984. X!         p2 += strlen(sprintf(p2, ".%d", val));
  985. X          }
  986. X+         pad = min(pad, val);
  987. X          *p2++ = 's', *p2 = 0;
  988. X          switch (*p) {
  989. X!         case 'f': p2 = from, do_pad = TRUE;
  990. X          when 'a':
  991. X              if (!*(p2 = addr))
  992. X              p2 = from;
  993. X+             do_pad = TRUE;
  994. X          when 'n':
  995. X              if (!*(p2 = name))
  996. X!             p2 = from, do_pad = TRUE;
  997. X          when '%': p2 = "%";
  998. X          when 't': p2 = to;
  999. X          when 's': p2 = subject;
  1000. X***************
  1001. X*** 406,411 ****
  1002. X--- 442,465 ----
  1003. X          }
  1004. X          otherwise: continue; /* unknown formatting char */
  1005. X          }
  1006. X+         if (do_pad && pad && strlen(p2) > pad) {
  1007. X+         char *old_p2 = p2;
  1008. X+         /* if addr is too long, move pointer forward till the
  1009. X+          * "important" part is readable only for ! paths/addresses.
  1010. X+          */
  1011. X+         while (p3 = index(p2, '!')) {
  1012. X+             p2 = p3+1;
  1013. X+             if (strlen(p2) + isauthor*4 < pad) {
  1014. X+             if (isauthor && (p2 -= 4) < old_p2)
  1015. X+                 p2 = old_p2;
  1016. X+             break;
  1017. X+             }
  1018. X+         }
  1019. X+         if (isauthor && p2 > old_p2+4 && !p3 && strlen(p2) + 4 > pad)
  1020. X+             p2 -= 4;
  1021. X+         if (old_p2 != p2 && isauthor)
  1022. X+             (void) strncpy(p2, "TO: ", 4); /* doesn't null terminate */
  1023. X+         }
  1024. X          len = strlen(sprintf(b, fmt, p2));
  1025. X          cnt += len, b += len;
  1026. X          /* Get around a bug in 5.5 IBM RT which pads with NULL's not ' ' */
  1027. X***************
  1028. X*** 816,836 ****
  1029. X      else if (*addr && Alts && *Alts && chk_two_lists(login,addr, "!@%=")) {
  1030. X          /* To be in this block, there must be a remote address */
  1031. X          i = 0; /* initialize 'i' in case while loop is skipped */
  1032. X- #ifndef SYSV
  1033. X          /* see if the hostnames match our hostname. */
  1034. X          while (i < MAX_HOST_NAMES && ourname[i])
  1035. X          if (chk_two_lists(addr, ourname[i++], "!@%="))
  1036. X              break;
  1037. X- #endif /* SYSV */
  1038. X          /* If one of the hostnames in the address is one of user's
  1039. X           * hostnames, remove this address. If the alternates
  1040. X           * hostnames listed contains a hostname in the address, remove
  1041. X           * from the list.
  1042. X           */
  1043. X!         if (
  1044. X! #ifndef SYSV
  1045. X!         i < MAX_HOST_NAMES && ourname[i] ||
  1046. X! #endif /* SYSV */
  1047. X          *Alts == '*' || !chk_two_lists(addr, Alts, "!@%= \t,"))
  1048. X              rm_me = TRUE;
  1049. X      }
  1050. X--- 870,885 ----
  1051. X      else if (*addr && Alts && *Alts && chk_two_lists(login,addr, "!@%=")) {
  1052. X          /* To be in this block, there must be a remote address */
  1053. X          i = 0; /* initialize 'i' in case while loop is skipped */
  1054. X          /* see if the hostnames match our hostname. */
  1055. X          while (i < MAX_HOST_NAMES && ourname[i])
  1056. X          if (chk_two_lists(addr, ourname[i++], "!@%="))
  1057. X              break;
  1058. X          /* If one of the hostnames in the address is one of user's
  1059. X           * hostnames, remove this address. If the alternates
  1060. X           * hostnames listed contains a hostname in the address, remove
  1061. X           * from the list.
  1062. X           */
  1063. X!         if (i < MAX_HOST_NAMES && ourname[i] ||
  1064. X          *Alts == '*' || !chk_two_lists(addr, Alts, "!@%= \t,"))
  1065. X              rm_me = TRUE;
  1066. X      }
  1067. X*** OLD/init.c    Thu Apr  7 22:46:51 1988
  1068. X--- init.c    Tue Jun 28 21:38:07 1988
  1069. X***************
  1070. X*** 101,113 ****
  1071. X  #include <netdb.h>
  1072. X  #endif /* BSD */
  1073. X  
  1074. X  void
  1075. X  init()
  1076. X  {
  1077. X!     char         *home;
  1078. X      extern char        *getlogin();
  1079. X  #ifdef SYSV
  1080. X      extern struct passwd *getpwuid();  /* sys-v forgot this in pwd.h! */
  1081. X  #else
  1082. X      char ourhost[128];
  1083. X  #endif /* SYSV */
  1084. X--- 101,119 ----
  1085. X  #include <netdb.h>
  1086. X  #endif /* BSD */
  1087. X  
  1088. X+ #ifdef SYSV
  1089. X+ #include <sys/utsname.h>
  1090. X+ #endif /* SYSV */
  1091. X+ 
  1092. X  void
  1093. X  init()
  1094. X  {
  1095. X!     char         *home, *realname;
  1096. X      extern char        *getlogin();
  1097. X+     char        buf[MAXPATHLEN];
  1098. X  #ifdef SYSV
  1099. X      extern struct passwd *getpwuid();  /* sys-v forgot this in pwd.h! */
  1100. X+     struct utsname ourhost;
  1101. X  #else
  1102. X      char ourhost[128];
  1103. X  #endif /* SYSV */
  1104. X***************
  1105. X*** 118,124 ****
  1106. X      struct hostent     *hp;
  1107. X  #endif /* BSD */
  1108. X  
  1109. X!     home = getenv ("HOME");
  1110. X  
  1111. X      if (!(entry = getpwuid(getuid())))
  1112. X      if (p = getlogin())
  1113. X--- 124,131 ----
  1114. X      struct hostent     *hp;
  1115. X  #endif /* BSD */
  1116. X  
  1117. X!     home = getenv("HOME");
  1118. X!     realname = getenv("NAME");
  1119. X  
  1120. X      if (!(entry = getpwuid(getuid())))
  1121. X      if (p = getlogin())
  1122. X***************
  1123. X*** 131,136 ****
  1124. X--- 138,147 ----
  1125. X      strdup(login, entry->pw_name);
  1126. X      if (!home || !*home)
  1127. X          home = entry->pw_dir;
  1128. X+     if (!realname && (realname = entry->pw_gecos)) {
  1129. X+         if (p = index(realname, ','))
  1130. X+         *p = 0;
  1131. X+     }
  1132. X      endpwent();
  1133. X      }
  1134. X      if (!home || !*home || Access(home, W_OK)) {
  1135. X***************
  1136. X*** 139,154 ****
  1137. X      else
  1138. X          print("No home!? ");
  1139. X      print_more("Using \"%s\" as home.\n", ALTERNATE_HOME);
  1140. X!     } else {
  1141. X!     char buf[MAXPATHLEN];
  1142. X!     cmd_line(sprintf(buf, "set home=\"%s\"", home), msg_list);
  1143. X!     }
  1144. X      crt = 25;
  1145. X      screen = 18;
  1146. X      escape = DEF_ESCAPE;
  1147. X      prompt = DEF_PROMPT;
  1148. X  
  1149. X! #ifndef SYSV
  1150. X      (void) gethostname(ourhost, sizeof ourhost);
  1151. X      if (!(hp = gethostbyname(ourhost)))
  1152. X      error("gethostbyname: %s", ourhost);
  1153. X--- 150,165 ----
  1154. X      else
  1155. X          print("No home!? ");
  1156. X      print_more("Using \"%s\" as home.\n", ALTERNATE_HOME);
  1157. X!     } else
  1158. X!     (void) cmd_line(sprintf(buf,"set home=\"%s\"", home), msg_list);
  1159. X!     if (realname)
  1160. X!     (void) cmd_line(sprintf(buf,"set realname=\"%s\"", realname), msg_list);
  1161. X      crt = 25;
  1162. X      screen = 18;
  1163. X      escape = DEF_ESCAPE;
  1164. X      prompt = DEF_PROMPT;
  1165. X  
  1166. X! #ifdef BSD
  1167. X      (void) gethostname(ourhost, sizeof ourhost);
  1168. X      if (!(hp = gethostbyname(ourhost)))
  1169. X      error("gethostbyname: %s", ourhost);
  1170. X***************
  1171. X*** 156,166 ****
  1172. X--- 167,185 ----
  1173. X            p = hp->h_aliases[cnt++])
  1174. X      ourname[cnt] = savestr(p);
  1175. X      endhostent();
  1176. X+ #endif /* BSD */
  1177. X+ #ifdef SYSV
  1178. X+     if (uname (&ourhost) >= 0)
  1179. X+     ourname[0] = savestr(ourhost.nodename);
  1180. X  #endif /* SYSV */
  1181. X  
  1182. X  #ifdef CURSES
  1183. X      init_bindings();
  1184. X  #endif /* CURSES */
  1185. X+ 
  1186. X+     if (ourname[0])
  1187. X+     (void) cmd_line(sprintf(buf,
  1188. X+             "set hostname=\"%s\"", ourname[0]), msg_list);
  1189. X  }
  1190. X  
  1191. X  /*
  1192. X***************
  1193. X*** 274,299 ****
  1194. X          goto bad;
  1195. X          }
  1196. X          /* "lhs" is the left hand side of the equation
  1197. X!          * In this instance, we're doing case 2 above.
  1198. X           */
  1199. X          if (*lhs == '!') {
  1200. X-         int tmp = argc;
  1201. X          equals = FALSE;
  1202. X!         if (!*++lhs)
  1203. X!             if (!(lhs = newargv[2])) {
  1204. X!             print("%s: %d: syntax error: \"if ! <what?>\"\n",
  1205. X!                 file, line_no);
  1206. X!             goto bad;
  1207. X!             } else
  1208. X!             tmp--;
  1209. X!         if (tmp > 2) {
  1210. X!             print("%s: %d: syntax error: \"if !<expr> <more junk>\"\n",
  1211. X              file, line_no);
  1212. X              goto bad;
  1213. X          }
  1214. X!         } else if (argc > 2) {
  1215. X          if (argc != 4) {
  1216. X!             print("%s: %d: argument count error: line has %d args.\n",
  1217. X              file, line_no, argc);
  1218. X              goto bad;
  1219. X          }
  1220. X--- 293,327 ----
  1221. X          goto bad;
  1222. X          }
  1223. X          /* "lhs" is the left hand side of the equation
  1224. X!          * In this instance, we're doing case 2 above (check for negation).
  1225. X           */
  1226. X          if (*lhs == '!') {
  1227. X          equals = FALSE;
  1228. X!         if (!*++lhs && !(lhs = newargv[2])) {
  1229. X!             print("%s: line %d: syntax error: \"if ! <what?>\"\n",
  1230. X              file, line_no);
  1231. X              goto bad;
  1232. X          }
  1233. X!         }
  1234. X!         if (*lhs == '-' && (lhs[1] == 'e' || lhs[1] == 'z') && !lhs[2]) {
  1235. X!         char *path;
  1236. X!         int n = 1; /* ignore ENOENT, I'll handle it here */
  1237. X!         struct stat statb;
  1238. X! 
  1239. X!         /* check for existence or zero-length folders/files */
  1240. X!         if (argc > 4) {
  1241. X!             print("%s: line %d: if %s \"filename\"\n",
  1242. X!             file, line_no, lhs);
  1243. X!             goto bad;
  1244. X!         }
  1245. X!         path = getpath(newargv[argc-1], &n);
  1246. X!         parsing = !equals ^ (n == -1 || n == 1 && lhs[1] == 'e' ||
  1247. X!             !stat(path, &statb) && (lhs[1] == 'e' || !statb.st_size));
  1248. X!         goto bad; /* it's not bad, but we're done anyway */
  1249. X!         }
  1250. X!         if (equals && argc > 2) {
  1251. X          if (argc != 4) {
  1252. X!             print("%s: %d: argument count error: %d args.\n",
  1253. X              file, line_no, argc);
  1254. X              goto bad;
  1255. X          }
  1256. X***************
  1257. X*** 301,307 ****
  1258. X          if (!strcmp(newargv[2], "!="))
  1259. X              equals = FALSE;
  1260. X          else if (strcmp(newargv[2], "==")) {
  1261. X!             print("%s: %d: use `==' or `!=' only.\n", file, line_no);
  1262. X              goto bad;
  1263. X          }
  1264. X          rhs = newargv[3];
  1265. X--- 329,335 ----
  1266. X          if (!strcmp(newargv[2], "!="))
  1267. X              equals = FALSE;
  1268. X          else if (strcmp(newargv[2], "==")) {
  1269. X!             print("%s: %d: use `==' or `!=' only.\n", file,line_no);
  1270. X              goto bad;
  1271. X          }
  1272. X          rhs = newargv[3];
  1273. X*** OLD/loop.c    Thu May 12 21:14:31 1988
  1274. X--- loop.c    Tue Jun 28 21:38:08 1988
  1275. X***************
  1276. X*** 58,64 ****
  1277. X                 SIG_DFL
  1278. X  #endif /* SYSV */
  1279. X                 );
  1280. X-     (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
  1281. X  
  1282. X      turnoff(glob_flags, IGN_SIGS);
  1283. X      if (hist_size == 0) /* if user didn't set history in .rc file */
  1284. X--- 58,63 ----
  1285. X***************
  1286. X*** 877,882 ****
  1287. X--- 876,886 ----
  1288. X      register int    list_num = TRUE, num_of_hists = hist_size;
  1289. X      register int    reverse = FALSE;
  1290. X      struct history    *hist = hist_tail;
  1291. X+ 
  1292. X+     if (!hist) {
  1293. X+     print("No history yet.\n");
  1294. X+     return;
  1295. X+     }
  1296. X  
  1297. X      while (*++argv && *argv[0] == '-') {
  1298. X      n = 1;
  1299. X*** OLD/mail.c    Mon Jun 13 15:38:27 1988
  1300. X--- mail.c    Tue Jul  5 22:48:43 1988
  1301. X***************
  1302. X*** 32,38 ****
  1303. X  static char Subject[BUFSIZ],To[BUFSIZ],Cc[BUFSIZ],Bcc[BUFSIZ],in_reply_to[256];
  1304. X  static int killme;
  1305. X  static u_long flags;
  1306. X! static int (*oldterm)(), (*oldint)(), (*oldquit)();
  1307. X  static void send_it();
  1308. X  static jmp_buf cntrl_c_buf;
  1309. X  FILE *ed_fp;
  1310. X--- 32,38 ----
  1311. X  static char Subject[BUFSIZ],To[BUFSIZ],Cc[BUFSIZ],Bcc[BUFSIZ],in_reply_to[256];
  1312. X  static int killme;
  1313. X  static u_long flags;
  1314. X! static SIGRET (*oldterm)(), (*oldint)(), (*oldquit)();
  1315. X  static void send_it();
  1316. X  static jmp_buf cntrl_c_buf;
  1317. X  FILE *ed_fp;
  1318. X***************
  1319. X*** 155,161 ****
  1320. X      turnoff(flgs, NEW_SUBJECT);
  1321. X      if (subj = subject_to(current_msg, buf))
  1322. X          subj = strcpy(Subject, buf + 4*(lower(firstchar) != 'r'));
  1323. X!     } else if (isoff(flgs, NEW_SUBJECT) && do_set(set_options, "ask"))
  1324. X      turnon(flgs, NEW_SUBJECT);
  1325. X      if (argv && *argv) {
  1326. X      char buf[BUFSIZ];
  1327. X--- 155,162 ----
  1328. X      turnoff(flgs, NEW_SUBJECT);
  1329. X      if (subj = subject_to(current_msg, buf))
  1330. X          subj = strcpy(Subject, buf + 4*(lower(firstchar) != 'r'));
  1331. X!     } else if (isoff(flgs, NEW_SUBJECT) &&
  1332. X!     (do_set(set_options, "ask") || do_set(set_options, "asksub")))
  1333. X      turnon(flgs, NEW_SUBJECT);
  1334. X      if (argv && *argv) {
  1335. X      char buf[BUFSIZ];
  1336. X***************
  1337. X*** 163,169 ****
  1338. X      fix_up_addr(buf);
  1339. X      to = &To[strlen(To)];
  1340. X      if (*To)
  1341. X!         to += Strcpy(to-1, ", ") - 1;
  1342. X      (void) strcpy(to, buf);
  1343. X      to = To;
  1344. X      }
  1345. X--- 164,170 ----
  1346. X      fix_up_addr(buf);
  1347. X      to = &To[strlen(To)];
  1348. X      if (*To)
  1349. X!         *to++ = ',', *to++ = ' ';
  1350. X      (void) strcpy(to, buf);
  1351. X      to = To;
  1352. X      }
  1353. X***************
  1354. X*** 410,416 ****
  1355. X       */
  1356. X      (void) setjmp(cntrl_c_buf);
  1357. X      while (Getstr(line, sizeof(line), 0) > -1) {
  1358. X!         (void) check_new_mail(); /* if new mail comes in, get it */
  1359. X          if ((i = add_to_letter(line)) <= 0)
  1360. X          break;
  1361. X      }
  1362. X--- 411,418 ----
  1363. X       */
  1364. X      (void) setjmp(cntrl_c_buf);
  1365. X      while (Getstr(line, sizeof(line), 0) > -1) {
  1366. X!         if (!istool) /* toolmode checks on a timer -- don't do it here */
  1367. X!         (void) check_new_mail(); /* if new mail comes in, get it */
  1368. X          if ((i = add_to_letter(line)) <= 0)
  1369. X          break;
  1370. X      }
  1371. X***************
  1372. X*** 564,570 ****
  1373. X          if (!(p2 = do_set(set_options, p)))
  1374. X          wprint("(%s isn't set)\n", p);
  1375. X          else
  1376. X!         fprintf(ed_fp, "%s\n", p2);
  1377. X      }
  1378. X      when ':': {
  1379. X          char new[MAXMSGS_BITS];
  1380. X--- 566,572 ----
  1381. X          if (!(p2 = do_set(set_options, p)))
  1382. X          wprint("(%s isn't set)\n", p);
  1383. X          else
  1384. X!         putstring(p2, ed_fp);
  1385. X      }
  1386. X      when ':': {
  1387. X          char new[MAXMSGS_BITS];
  1388. X***************
  1389. X*** 851,860 ****
  1390. X          return 1;
  1391. X          } else if (line[1] == '?') {
  1392. X          register int x;
  1393. X!         for (x = 0; tilde_commands[x]; x++)
  1394. X!             wprint("%s%s\n", escape, tilde_commands[x]);
  1395. X!         wprint("%s%s\t\tbegin a line with a single %s\n",
  1396. X              escape, escape, escape);
  1397. X  #ifdef SUNTOOL
  1398. X          if (istool)
  1399. X              (void) help(0, "compose", tool_help);
  1400. X--- 853,877 ----
  1401. X          return 1;
  1402. X          } else if (line[1] == '?') {
  1403. X          register int x;
  1404. X!         if (!istool)
  1405. X!             (void) do_pager(NULL, TRUE); /* start pager */
  1406. X!         for (x = 0; tilde_commands[x]; x++) {
  1407. X!             (void) sprintf(buf, "%s%s\n", escape, tilde_commands[x]);
  1408. X!             if (!istool) {
  1409. X!             if (do_pager(buf, FALSE))
  1410. X!                 break;
  1411. X!             } else
  1412. X!             wprint(buf);
  1413. X!         }
  1414. X!         (void) sprintf(buf, "%s%s\t\tbegin a line with a single %s\n",
  1415. X              escape, escape, escape);
  1416. X+         if (istool)
  1417. X+             wprint(buf);
  1418. X+         else {
  1419. X+             if (tilde_commands[x] == NULL)
  1420. X+             (void) do_pager(buf, FALSE);
  1421. X+             (void) do_pager(NULL, FALSE); /* end pager */
  1422. X+         }
  1423. X  #ifdef SUNTOOL
  1424. X          if (istool)
  1425. X              (void) help(0, "compose", tool_help);
  1426. X***************
  1427. X*** 970,975 ****
  1428. X--- 987,993 ----
  1429. X      int next_file = 1; /* reserve files[0] for the mail delivery program */
  1430. X      char buf[3*BUFSIZ];
  1431. X      char expand = !do_set(set_options, "no_expand");
  1432. X+     int fork_err = 0;
  1433. X  
  1434. X      if (!istool) {
  1435. X      (void) signal(SIGINT, oldint);
  1436. X***************
  1437. X*** 1047,1053 ****
  1438. X      /* Sign the letter before adding the Bcc list since they aren't
  1439. X       * considered when adding a signature.
  1440. X       */
  1441. X!     if ((ison(flags, SIGN) || ison(flags, FORTUNE)) &&
  1442. X      isoff(glob_flags, REDIRECT) && isoff(flags, FORWARD))
  1443. X      sign_letter(addr_list);
  1444. X  
  1445. X--- 1065,1071 ----
  1446. X      /* Sign the letter before adding the Bcc list since they aren't
  1447. X       * considered when adding a signature.
  1448. X       */
  1449. X!     if ((ison(flags, SIGN) || ison(flags, DO_FORTUNE)) &&
  1450. X      isoff(glob_flags, REDIRECT) && isoff(flags, FORWARD))
  1451. X      sign_letter(addr_list);
  1452. X  
  1453. X***************
  1454. X*** 1070,1079 ****
  1455. X      }
  1456. X      }
  1457. X  
  1458. X! #ifdef OLD_MAILER
  1459. X      for (p = buf; p = index(p, ','); p++)
  1460. X      *p = ' ';
  1461. X! #endif /* OLD_MAILER */
  1462. X  
  1463. X      Debug("mail command: %s\n", buf);
  1464. X  
  1465. X--- 1088,1097 ----
  1466. X      }
  1467. X      }
  1468. X  
  1469. X! #ifdef NO_COMMAS
  1470. X      for (p = buf; p = index(p, ','); p++)
  1471. X      *p = ' ';
  1472. X! #endif /* NO_COMMAS */
  1473. X  
  1474. X      Debug("mail command: %s\n", buf);
  1475. X  
  1476. X***************
  1477. X*** 1105,1117 ****
  1478. X          break;
  1479. X          case -1:
  1480. X          error("fork failed trying to send mail");
  1481. X          default:
  1482. X          if (isoff(glob_flags, REDIRECT))
  1483. X              fclose(ed_fp);
  1484. X  #ifdef SUNTOOL
  1485. X                  if (istool) {
  1486. X!             wprint("Letter sent.");
  1487. X!             print("Letter sent.");
  1488. X              type_cursor(PIX_CLR);
  1489. X          }
  1490. X  #endif /* SUNTOOL */
  1491. X--- 1123,1138 ----
  1492. X          break;
  1493. X          case -1:
  1494. X          error("fork failed trying to send mail");
  1495. X+         fork_err++;
  1496. X          default:
  1497. X          if (isoff(glob_flags, REDIRECT))
  1498. X              fclose(ed_fp);
  1499. X  #ifdef SUNTOOL
  1500. X                  if (istool) {
  1501. X!             if (!fork_err) {
  1502. X!             wprint("Letter sent.");
  1503. X!             print("Letter sent.");
  1504. X!             }
  1505. X              type_cursor(PIX_CLR);
  1506. X          }
  1507. X  #endif /* SUNTOOL */
  1508. X***************
  1509. X*** 1142,1165 ****
  1510. X  
  1511. X      /* Make folders conform to RFC-822 by adding From: and Date: headers.
  1512. X       * Some older mailers (binmail, execmail, delivermail), don't add
  1513. X!      * these headers to the MTA, so add them for OLD_MAILER systems.
  1514. X       */
  1515. X!     for (size = 0; size < next_file; size++) {
  1516. X      time_t t;
  1517. X  #ifndef OLD_MAILER
  1518. X!     if (size == 0)
  1519. X!         continue;
  1520. X  #endif /* OLD_MAILER */
  1521. X!     (void) time(&t);
  1522. X!     if (size > 0) {
  1523. X  #ifndef MSG_SEPARATOR
  1524. X!         fprintf(files[size], "From %s %s", login, ctime(&t));
  1525. X  #else /* MSG_SEPARATOR */
  1526. X!         fprintf(files[size], "%s\n", MSG_SEPARATOR);
  1527. X  #endif /* MSG_SEPARATOR */
  1528. X      }
  1529. X-     fprintf(files[size], "From: %s\n", login);
  1530. X-     fprintf(files[size], "Date: %s", ctime(&t));
  1531. X      }
  1532. X  
  1533. X      /* first print users own message headers */
  1534. X--- 1163,1206 ----
  1535. X  
  1536. X      /* Make folders conform to RFC-822 by adding From: and Date: headers.
  1537. X       * Some older mailers (binmail, execmail, delivermail), don't add
  1538. X!      * these headers, so add them for #define OLD_MAILER
  1539. X       */
  1540. X!     {
  1541. X      time_t t;
  1542. X+     char From_buf[256], *pF = From_buf;
  1543. X+     char *host = do_set(set_options, "hostname");
  1544. X+ 
  1545. X+     pF += Strcpy(From_buf, "From: ");
  1546. X+     if (!host)
  1547. X+         host = ourname[0];
  1548. X+ #ifdef UUCP
  1549. X+     if (host && *host)
  1550. X+         pF += strlen(sprintf(pF, "%s!", host));
  1551. X+ #endif /* UUCP */
  1552. X+     pF += Strcpy(pF, login);
  1553. X+ #ifndef UUCP
  1554. X+     if (host && *host)
  1555. X+         pF += strlen(sprintf(pF, "@%s", host));
  1556. X+ #endif /* UUCP */
  1557. X+     if (p = do_set(set_options, "realname"))
  1558. X+         pF += strlen(sprintf(pF, " (%s)", p));
  1559. X+     *pF++ = '\n', *pF++ = 0;
  1560. X+     (void) time(&t);
  1561. X+     for (size = 0; size < next_file; size++) {
  1562. X  #ifndef OLD_MAILER
  1563. X!         if (size == 0)
  1564. X!         continue;
  1565. X  #endif /* OLD_MAILER */
  1566. X!         if (size > 0) {
  1567. X  #ifndef MSG_SEPARATOR
  1568. X!         fprintf(files[size], "From %s %s", login, ctime(&t));
  1569. X  #else /* MSG_SEPARATOR */
  1570. X!         fprintf(files[size], "%s\n", MSG_SEPARATOR);
  1571. X  #endif /* MSG_SEPARATOR */
  1572. X+         }
  1573. X+         fputs(From_buf, files[size]);
  1574. X+         fprintf(files[size], "Date: %s", ctime(&t));
  1575. X      }
  1576. X      }
  1577. X  
  1578. X      /* first print users own message headers */
  1579. X***************
  1580. X*** 1203,1210 ****
  1581. X--- 1244,1253 ----
  1582. X       */
  1583. X      while (fgets(buf, BUFSIZ, ed_fp))
  1584. X      for (size = 0; size < next_file; size++) {
  1585. X+ #ifdef MSG_SEPARATOR
  1586. X          if (!strncmp(buf, "From ", 5))
  1587. X          fputc('>', files[size]);
  1588. X+ #endif /* MSG_SEPARATOR */
  1589. X          fputs(buf, files[size]);
  1590. X      }
  1591. X  
  1592. X***************
  1593. X*** 1230,1235 ****
  1594. X--- 1273,1279 ----
  1595. X  }
  1596. X  
  1597. X  /* ARGSUSED */
  1598. X+ SIGRET
  1599. X  rm_edfile(sig)
  1600. X  {
  1601. X      if (sig > 0 && !killme) {
  1602. X***************
  1603. X*** 1419,1429 ****
  1604. X      if (*buf == '$')
  1605. X          if (!(p = do_set(set_options, buf)))
  1606. X          wprint("(%s isn't set -- letter not signed)\n", buf);
  1607. X!         else
  1608. X!         fprintf(ed_fp, "%s\n", p), wprint("\n"), fflush(ed_fp);
  1609. X!     else if (*buf == '\\')
  1610. X!         fprintf(ed_fp, "%s\n", buf+1), wprint("\n"), fflush(ed_fp);
  1611. X!     else
  1612. X          file_to_fp(buf, ed_fp, "r");
  1613. X      }
  1614. X  
  1615. X--- 1463,1476 ----
  1616. X      if (*buf == '$')
  1617. X          if (!(p = do_set(set_options, buf)))
  1618. X          wprint("(%s isn't set -- letter not signed)\n", buf);
  1619. X!         else {
  1620. X!         putstring(p+1, ed_fp);
  1621. X!         wprint("\n");
  1622. X!         }
  1623. X!     else if (*buf == '\\') {
  1624. X!         putstring(buf, ed_fp);
  1625. X!         wprint("\n");
  1626. X!     } else
  1627. X          file_to_fp(buf, ed_fp, "r");
  1628. X      }
  1629. X  
  1630. X*** OLD/main.c    Thu May 12 21:14:34 1988
  1631. X--- main.c    Tue Jun 28 21:38:11 1988
  1632. X***************
  1633. X*** 20,25 ****
  1634. X--- 20,29 ----
  1635. X  }
  1636. X  #endif /* sun && DEBUG */
  1637. X  
  1638. X+ #ifdef DOT_LOCK
  1639. X+ int sgid;
  1640. X+ #endif /* DOT_LOCK */
  1641. X+ 
  1642. X  /*ARGSUSED*/   /* we ignore envp */
  1643. X  main(argc, argv)
  1644. X  char **argv;
  1645. X***************
  1646. X*** 38,43 ****
  1647. X--- 42,48 ----
  1648. X  
  1649. X      (void) signal(SIGBUS,  bus_n_seg);
  1650. X      (void) signal(SIGSEGV, bus_n_seg);
  1651. X+     (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
  1652. X  
  1653. X      f_flags[0] = 0;
  1654. X      mailfile = "";
  1655. X***************
  1656. X*** 58,67 ****
  1657. X      n = 0; /* don't ignore no such file or directory */
  1658. X      p = getpath(COMMAND_HELP, &n);
  1659. X  
  1660. X!     if (n) {
  1661. X!     fprintf(stderr, "Warning: can't read %s: %s\n", COMMAND_HELP, p);
  1662. X      cmd_help = "cmd_help";
  1663. X!     } else
  1664. X      strdup(cmd_help, p);
  1665. X  
  1666. X      init(); /* must be done before checking mail since "login" is set here */
  1667. X--- 63,71 ----
  1668. X      n = 0; /* don't ignore no such file or directory */
  1669. X      p = getpath(COMMAND_HELP, &n);
  1670. X  
  1671. X!     if (n)
  1672. X      cmd_help = "cmd_help";
  1673. X!     else
  1674. X      strdup(cmd_help, p);
  1675. X  
  1676. X      init(); /* must be done before checking mail since "login" is set here */
  1677. X***************
  1678. X*** 130,135 ****
  1679. X--- 134,144 ----
  1680. X      }
  1681. X      }
  1682. X  
  1683. X+ #ifdef DOT_LOCK
  1684. X+     sgid = getegid();
  1685. X+     setgid(getgid());
  1686. X+ #endif DOT_LOCK
  1687. X+ 
  1688. X      for (++argv; *argv && **argv == '-'; argv++)
  1689. X      switch (argv[0][1]) {
  1690. X          case 'e':
  1691. X***************
  1692. X*** 391,402 ****
  1693. X  #ifdef SUNTOOL
  1694. X      if (istool) {
  1695. X      n = 0;
  1696. X!     p = getpath(TOOL_HELP, &n);
  1697. X!     if (n) {
  1698. X!         fprintf(stderr, "Warning: can't read %s: %s\n", TOOL_HELP, p);
  1699. X!         tool_help = "tool_help";
  1700. X!     } else
  1701. X!         strdup(tool_help, p);
  1702. X      if (time_out < 30)
  1703. X          time_out = 60;
  1704. X      turnoff(glob_flags, IGN_SIGS);
  1705. X--- 400,413 ----
  1706. X  #ifdef SUNTOOL
  1707. X      if (istool) {
  1708. X      n = 0;
  1709. X!     if (!tool_help) {
  1710. X!         p = getpath(TOOL_HELP, &n);
  1711. X!         if (n) {
  1712. X!         fprintf(stderr, "Warning: can't read %s: %s\n", TOOL_HELP, p);
  1713. X!         tool_help = "tool_help";
  1714. X!         } else
  1715. X!         strdup(tool_help, p);
  1716. X!     }
  1717. X      if (time_out < 30)
  1718. X          time_out = 60;
  1719. X      turnoff(glob_flags, IGN_SIGS);
  1720. X*** OLD/makefile.bsd    Thu May 12 21:14:35 1988
  1721. X--- makefile.bsd    Tue Jun 28 21:38:12 1988
  1722. X***************
  1723. X*** 8,14 ****
  1724. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1725. X        folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
  1726. X  
  1727. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help
  1728. X  
  1729. X  MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
  1730. X  
  1731. X--- 8,14 ----
  1732. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1733. X        folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
  1734. X  
  1735. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 mush.1 cmd_help
  1736. X  
  1737. X  MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
  1738. X  
  1739. X*** OLD/makefile.sun    Thu May 12 21:14:36 1988
  1740. X--- makefile.sun    Thu Jun 30 13:05:54 1988
  1741. X***************
  1742. X*** 17,23 ****
  1743. X  IMAGES= mail.icon.1 mail.icon.2 check.pr cycle.pr envelope.pr glasses.pr \
  1744. X      write.pr up.arrow.pr dn.arrow.pr coffee.cup.pr
  1745. X  
  1746. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help tool_help
  1747. X  
  1748. X  MAKES= makefile.sun makefile.bsd makefile.sys.v makefile.x286 makefile.x386
  1749. X  
  1750. X--- 17,24 ----
  1751. X  IMAGES= mail.icon.1 mail.icon.2 check.pr cycle.pr envelope.pr glasses.pr \
  1752. X      write.pr up.arrow.pr dn.arrow.pr coffee.cup.pr
  1753. X  
  1754. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 \
  1755. X!     mush.1 cmd_help tool_help
  1756. X  
  1757. X  MAKES= makefile.sun makefile.bsd makefile.sys.v makefile.x286 makefile.x386
  1758. X  
  1759. X***************
  1760. X*** 31,37 ****
  1761. X      @cc $(LDFLAGS) $(OBJS) $(LIBES) -o mush
  1762. X  
  1763. X  tar:
  1764. X!     @tar fcv MUSH $(HELP_FILES) $(MAKES) $(IMAGES) $(HDRS) $(SRCS)
  1765. X  
  1766. X  lint:
  1767. X      make -f makefile.bsd lint
  1768. X--- 32,38 ----
  1769. X      @cc $(LDFLAGS) $(OBJS) $(LIBES) -o mush
  1770. X  
  1771. X  tar:
  1772. X!     @tar fcv MUSH $(HELP_FILES) $(MAKES) $(IMAGES) $(HDRS) $(SRCS) Mailrc
  1773. X  
  1774. X  lint:
  1775. X      make -f makefile.bsd lint
  1776. X*** OLD/makefile.x286    Thu May 12 21:14:37 1988
  1777. X--- makefile.x286    Tue Jun 28 21:38:13 1988
  1778. X***************
  1779. X*** 10,17 ****
  1780. X  OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  1781. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1782. X        folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
  1783. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help
  1784. X! MAKES= makefile.sys.v makefile.xenix makefile.bsd
  1785. X  
  1786. X  CFLAGS= -O -DSYSV -Mle -DCURSES -DREGCMP -DUSG
  1787. X  LDFLAGS= -X -Mle -lx -F 4000
  1788. X--- 10,17 ----
  1789. X  OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  1790. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1791. X        folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
  1792. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 mush.1 cmd_help
  1793. X! MAKES= makefile.sys.v makefile.x286 makefile.x386 makefile.bsd
  1794. X  
  1795. X  CFLAGS= -O -DSYSV -Mle -DCURSES -DREGCMP -DUSG
  1796. X  LDFLAGS= -X -Mle -lx -F 4000
  1797. X*** OLD/makefile.x386    Thu May 12 21:14:37 1988
  1798. X--- makefile.x386    Tue Jun 28 21:38:14 1988
  1799. X***************
  1800. X*** 10,17 ****
  1801. X  OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  1802. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1803. X        folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
  1804. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help
  1805. X! MAKES= makefile.sys.v makefile.xenix makefile.bsd
  1806. X  
  1807. X  CFLAGS= -O -DSYSV -M3e -DCURSES -DREGCMP -DUSG 
  1808. X  LDFLAGS= -X -M3 -lx
  1809. X--- 10,17 ----
  1810. X  OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  1811. X        signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1812. X        folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
  1813. X! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 mush.1 cmd_help
  1814. X! MAKES= makefile.sys.v makefile.286 makefile.x386 makefile.bsd
  1815. X  
  1816. X  CFLAGS= -O -DSYSV -M3e -DCURSES -DREGCMP -DUSG 
  1817. X  LDFLAGS= -X -M3 -lx
  1818. X*** OLD/misc.c    Thu May 12 21:14:38 1988
  1819. X--- misc.c    Tue Jun 28 21:38:15 1988
  1820. X***************
  1821. X*** 23,31 ****
  1822. X  }
  1823. X  
  1824. X  /*
  1825. X!  * loop thru all msgs starting with current_msg and find next undeleted
  1826. X!  * message.  If the variable "wrap" is set, wrap to the beginning of the
  1827. END_OF_FILE
  1828. if test 57387 -ne `wc -c <'Diffs.6.3.a'`; then
  1829.     echo shar: \"'Diffs.6.3.a'\" unpacked with wrong size!
  1830. fi
  1831. # end of 'Diffs.6.3.a'
  1832. fi
  1833. echo shar: End of shell archive.
  1834. exit 0
  1835.